home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / oldunits_neweffects / heavybot2_shot_fly.lua < prev    next >
Encoding:
Text File  |  2006-02-27  |  2.3 KB  |  84 lines

  1. function heavybot2_shot_fly1()
  2.     local explosion = uniGetExecutor()
  3.     explosion:setTransformOwner()
  4.     local mshot1 = explosion:addSimpleEffect(ENET_EFFECT_PS_HEAVYBOT2SHOT_FLY)
  5.     local shotlight = explosion:addSimpleEffect(ENET_EFFECT_HEAVYBOT2_LIGHTSPOT)
  6. --    waitDeath(explosion:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,250,uniGetTarget()),1000)
  7.     waitDeath(explosion:forwardFly(uniGetTarget(),250))
  8.     mshot1:suspendedDestroy(4.0)
  9.     local exp_ps = explosion:addSimpleEffect(ENET_EFFECT_PS_HEAVYBOT2SHOT_EXPLOSION)
  10.     uniGetTarget():executeCommand(ENC_DAMAGED)
  11.     pause(1.0)
  12.     exp_ps:suspendedDestroy(1.5)
  13.     shotlight:suspendedDestroy(1.5)
  14.     pause(1.5)
  15.     explosion:destroy()
  16. end
  17.  
  18. registerCommand(ENSCRIPTSET_HEAVYBOT2SHOT,ENC_FIRE1,"heavybot2_shot_fly1")
  19.  
  20. --
  21. -- dummy effect creation test
  22. --
  23. desc = getEffectDescriptionP(ENET_EFFECT_HEAVYBOT2SHOT_FLY)
  24. desc.ClassID = ENCLASS_DUMMY
  25. desc.EffectClassType = ENECT_GEOMETRY
  26.  
  27. desc.ScriptSet = ENSCRIPTSET_HEAVYBOT2SHOT
  28. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  29. local vzbzd1 = D3DXVECTOR3:new(0,0,0)
  30. desc.LocalPosition = vzbzd1
  31. vzbzd1:delete()
  32. desc.MoveType = ENMOVE_FLY
  33.  
  34. desc.ActivityType = ENACT_COMMANDSEMIACTIVE
  35. --
  36. -- end dummy effect creation test
  37. --
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. --
  46. -- lightsource creation test
  47. --
  48. desc = getEffectDescriptionP(ENET_EFFECT_HEAVYBOT2_LIGHTSPOT)
  49. desc.ClassID = ENCLASS_LIGHTSOURCE
  50. desc.EffectClassType = ENECT_LIGHTSOURCE
  51.  
  52. desc.ScriptSet = ENSCRIPTSET_UNKNOWN
  53. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  54. local vzbzd2 = D3DXVECTOR3:new(0,0,0)
  55. desc.LocalPosition = vzbzd2
  56. vzbzd2:delete()
  57. desc.ActivityType = ENACT_SEMIACTIVE
  58.  
  59. -- add interpolators
  60. --desc.clearInterpolators()
  61.  
  62. local interpolator = createInterpolator()
  63. interpolator:addKey(0.0,70.0)
  64. interpolator:addKey(10.0,70.0)
  65. interpolator:finalize(false)
  66. -- add interpolator on light range
  67. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_LIGHT_RANGE))
  68.  
  69. local interpolator = createInterpolator()
  70. interpolator:addKey(0.0,1.0)
  71. interpolator:addKey(1.0,0.0)
  72. interpolator:addKey(7.0,0.0)
  73. interpolator:finalize(false)
  74. -- add interpolator on R B colors
  75. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_R))
  76. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_B))
  77. desc:addInterpolator(interpolator,getFieldOffset(EN_FIELD_DIFFUSE_G))
  78.  
  79.  
  80.  
  81. --
  82. -- end lightsource creation description
  83. --
  84.